package com.example.demo.service.db.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.TUser;
import com.example.demo.mapper.TUserMapper;
import com.example.demo.service.db.TUserDBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * t_user表操作实现类
 *
 * @author tulc
 */
@Service
public class TUserDBServiceImpl extends ServiceImpl<TUserMapper, TUser> implements TUserDBService {

    @Autowired
    private TUserMapper tUserMapper;

    /**
     * 测试resultMap
     */
    @Override
    public List<TUser> testResultMap(){
        return tUserMapper.testResultMap();
    }

    /**
     * 测试主键返回
     */
    @Override
    public int testKeyGenerate(TUser tUser) {
        return tUserMapper.testKeyGenerate(tUser);
    }

    /**
     * 测试主键返回02
     */
    @Override
    public int testKeyGenerate02(TUser tUser) {
        return tUserMapper.testKeyGenerate02(tUser);
    }

    /**
     * 测试set标签
     */
    @Override
    public int updateIfAndSetOper(TUser tUser) {
        return tUserMapper.updateIfAndSetOper(tUser);
    }

    /**
     * 测试trim标签
     */
    @Override
    public int insertIfAndTrimOper(TUser tUser) {
        return tUserMapper.insertIfAndTrimOper(tUser);
    }

    /**
     * 查询批量插入的数据
     *
     * @param names
     *      姓名数组
     * @return
     */
    @Override
    public List<TUser> selectForeach4In(String[] names) {
        return tUserMapper.selectForeach4In(names);
    }

    /**
     * 批量插入
     *
     * @param tUserList
     *      t_user表对应实体列表
     * @return
     */
    @Override
    public int insertForeach4Batch(List<TUser> tUserList) {
        return tUserMapper.insertForeach4Batch(tUserList);
    }

}
